package com.ckjava.service;

import com.ckjava.aop.annotation.MultiDataSource;
import com.ckjava.dao.TOrderDao;
import com.ckjava.entity.DbEnum;
import com.ckjava.entity.TOrderEntity;
import com.ckjava.entity.base.PageParamer;
import com.ckjava.service.base.BaseMybatisCrudService;
import com.ckjava.xutils.http.Page;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class TOrderService extends BaseMybatisCrudService<TOrderEntity, TOrderDao> {

    @Override
    public Class<TOrderEntity> getClassType() {
        return TOrderEntity.class;
    }

    @Override
    @MultiDataSource(DbEnum.order)
    public Optional<TOrderEntity> get(long id) {
        return super.get(id);
    }

    @Override
    @MultiDataSource(DbEnum.order)
    public Optional<List<TOrderEntity>> getAll() {
        return super.getAll();
    }

    @Override
    @MultiDataSource(DbEnum.order)
    public Optional<List<TOrderEntity>> getByParam(TOrderEntity entity) {
        return super.getByParam(entity);
    }

    @Override
    @MultiDataSource(DbEnum.order)
    public Optional<Page<TOrderEntity>> getPage(PageParamer pageParamer) {
        return super.getPage(pageParamer);
    }

    @Override
    @MultiDataSource(DbEnum.order)
    public Optional<Long> save(TOrderEntity entity) {
        return super.save(entity);
    }

    @Override
    @MultiDataSource(DbEnum.order)
    public Optional<Long> update(TOrderEntity entity) {
        return super.update(entity);
    }

    @Override
    @MultiDataSource(DbEnum.order)
    public Optional<Long> saveOrUpdate(TOrderEntity entity) {
        return super.saveOrUpdate(entity);
    }

    @Override
    @MultiDataSource(DbEnum.order)
    public Optional<Integer> delete(Long id) {
        return super.delete(id);
    }

    @Override
    @MultiDataSource(DbEnum.order)
    public Optional<Integer> deletePhysical(Long id) {
        return super.deletePhysical(id);
    }
}

